package com.example.demo.exception;

import com.example.demo.domain.dto.ResultCode;
import lombok.Getter;

/**
 * 自定义异常
 *
 * @author renliang
 */
@Getter
public class CustomException extends RuntimeException {
    private ResultCode result;

    public CustomException(String msg) {
        super(msg);
    }

    public CustomException(ResultCode result) {
        super(result.getMsg());
        this.result = result;
    }

    public CustomException(String msg, ResultCode result) {
        super(msg);
        this.result = result;
    }

    public CustomException(String message, Throwable cause) {
        super(message, cause);
    }
}
